package com.gljx.web.service.impl;

import com.gljx.web.Entity.Specificationtable;
import com.gljx.web.Entity.Typetable;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.SpecificationtableMapper;
import com.gljx.web.dao.TypetableMapper;
import com.gljx.web.service.DropDownMenuOptionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: WuLianFa
 * @CreationTime: 2018/5/24 0024 08:58
 */
@Service
public class DropDownMenuOptionsServiceImpl extends CommonDao implements DropDownMenuOptionsService {
    @Autowired
    private SpecificationtableMapper specificationtableMapper;//规格业务逻辑
    @Autowired
    private TypetableMapper typetableMapper;//类型业务逻辑

    /**
     * 查询全部规格信息
     * Created by WuLianFa on 2018/5/24 0024 09:00
     */
    public List<Specificationtable> queryAllSpecificationMassage() {
        return specificationtableMapper.queryAllSpecificationMassage();
    }

    /**
     * 通过ID删除规格信息
     * Created by WuLianFa on 2018/5/24 0024 09:08
     */
    public int deleteSpecificationMassageById(String ggId) {
        return specificationtableMapper.deleteByPrimaryKey(ggId);
    }

    /**
     * 通过实体类增加规格信息
     * Created by WuLianFa on 2018/5/24 0024 09:09
     */
    public int addSpecificationMassage(Specificationtable specificationtable) {
        return specificationtableMapper.insertSelective(specificationtable);
    }

    /**
     * 通过实体类修改规格信息
     * Created by WuLianFa on 2018/5/24 0024 09:09
     */
    public int updateSpecificationMassage(Specificationtable specificationtable) {
        return specificationtableMapper.updateByPrimaryKeySelective(specificationtable);
    }

    /**
     * 查询全部类型信息
     * Created by WuLianFa on 2018/5/24 0024 09:00
     */
    public List<Typetable> queryAllTypeMassage() {
        return typetableMapper.queryAllTypeMassage();
    }

    /**
     * 通过ID删除类型信息
     * Created by WuLianFa on 2018/5/24 0024 09:07
     */
    public int deleteTypeMassageById(String lxId) {
        return typetableMapper.deleteByPrimaryKey(lxId);
    }

    /**
     * 通过实体类增加类型信息
     * Created by WuLianFa on 2018/5/24 0024 09:08
     */
    public int addTypeMassage(Typetable typetable) {
        return typetableMapper.insertSelective(typetable);
    }

    /**
     * 通过实体类修改类型信息
     * Created by WuLianFa on 2018/5/24 0024 09:08
     */
    public int updateTypeMassage(Typetable typetable) {
        return typetableMapper.updateByPrimaryKeySelective(typetable);
    }

}
